<?php
/**
 * @Author: lianlianzan(13040@qq.com)
 * @Date:   2018-08-18 16:40:16
 * @Last Modified by:   lianlianzan
 * @Last Modified time: 2022-03-27 00:00:26
 */

namespace app\admin\controller;
use app\common\controller\Backend;

class Index extends Backend {

	function initialize() {
		parent::initialize();
		$this->saveAndGetConfigIdentify('', '管理首页', '', '');
	}

	/**
	 * 首页
	 */
	public function index() {
		if (config('app.dashboard_page')) {
			$this->redirect(url(config('app.dashboard_page')));
		}
		
		return $this->fetch();
	}

	/**
	 * 清理缓存
	 */
	public function delCache() {
		\think\facade\Cache::clear();
		//print_r($_SERVER['SERVER_ADDR']);
		$this->success('清除缓存成功！(服务器：'.$_SERVER['SERVER_ADDR'].')');
	}
	
}